﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.ViewModel;
using System.Collections.ObjectModel;
using ZhiHeng.Consume.DataContract;

namespace ZhiHeng.OneCard.WpfClient.Model
{
    /// <summary>
    /// 卡类型
    /// </summary>
    public class CardType
    {
        public object CardTypeID { get; set; }
        public object CardTypeName { get; set; }
        public static ObservableCollection<Model.CardType> GetDefaultCardType()
        {
            return new ObservableCollection<Model.CardType>() {
                 new Model.CardType() { CardTypeID=0x02, CardTypeName="会员计次卡" },
                 new Model.CardType() {  CardTypeID=0x13, CardTypeName="会员计费卡" },
                 new Model.CardType() {   CardTypeID=0x21, CardTypeName="员工卡"}};
        }
        public static ObservableCollection<Model.CardType> GetCardType()
        {
            return new ObservableCollection<Model.CardType>() {
                 new Model.CardType() { CardTypeID=0x11, CardTypeName="消费卡" },
                 new Model.CardType() {  CardTypeID=0x01, CardTypeName="门票卡" },
                 new Model.CardType() {   CardTypeID=0x12, CardTypeName="游客卡"},
                  new Model.CardType() {   CardTypeID=0x30, CardTypeName="VIP卡"}
            };
        }
    }
    public class ComboxItem
    {
        public static ObservableCollection<Model.CardType> SelectType()
        {
            return new ObservableCollection<Model.CardType>() 
            {
                 new Model.CardType() { CardTypeID=1, CardTypeName="柜号" },
                 new Model.CardType() {  CardTypeID=2, CardTypeName="姓名" },
                 new Model.CardType() {   CardTypeID=3, CardTypeName="证件号"},
                 new Model.CardType() {  CardTypeID=4, CardTypeName="电话" }
            };
        }
    }
    public class ComboxCardType
    {
        public static ObservableCollection<Model.CardType> SelectCardType()
        {
            return new ObservableCollection<Model.CardType>() 
            {
                  new Model.CardType() {  CardTypeID="", CardTypeName="全部" },
                 new Model.CardType() {  CardTypeID="6", CardTypeName="休眠" },
                 new Model.CardType() { CardTypeID="3", CardTypeName="挂失" },
                 new Model.CardType() {  CardTypeID="4", CardTypeName="冻结" },
                 new Model.CardType() {   CardTypeID="5", CardTypeName="锁定"},
                 new Model.CardType() {  CardTypeID="6", CardTypeName="已激活" }
            };
        }
    }
    public class AuthoCardType
    {
        public static ObservableCollection<Model.CardType> SelectCardType()
        {
            return new ObservableCollection<Model.CardType>() 
            {
                  new Model.CardType() {  CardTypeID="99999999", CardTypeName="一级授权卡" },
                 new Model.CardType() {  CardTypeID="100000", CardTypeName="二级授权卡" },
                 new Model.CardType() { CardTypeID="10000", CardTypeName="三级授权卡" },
                 new Model.CardType() {  CardTypeID="8000", CardTypeName="四级授权卡" },
                 new Model.CardType() {   CardTypeID="5000", CardTypeName="五级授权卡"}
            };
        }
    }
    public class SuperMKTType:ViewModel.ViewModelBase
    {
        public ObservableCollection<Model.CardType> GetDefaultSuperType()
        {
            var query = new ConfigTreeInfo().ExtGetAll();
            var q = from c in query where c.Type == (Int32)Common.StaticDicdictionary.TypeDicdictionary.商户类型 select c;
            var source = new ObservableCollection<Model.CardType>();
            foreach (var item in q)
            {
                source.Add(new Model.CardType() { CardTypeID = item.Code, CardTypeName = item.Name });
            }
            return source;
        }
        public ObservableCollection<Model.CardType> GetSuperSub()
        {
            var query = WcfOneCardActionService.QuerySuperMKTSub("022", 4);
            var source = new ObservableCollection<Model.CardType>();
            foreach (var item in query)
            {
                source.Add(new Model.CardType() { CardTypeID = item.SubjectCode, CardTypeName = item.SubjectName });
            }
            return source;
        }
    }
}
